package com.xinzhi.controller;

import com.xinzhi.pojo.dto.Dtokoufen;
import com.xinzhi.service.AppraisalService;
import com.xinzhi.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class PointController {
    @Autowired
    private AppraisalService appraisalService;

    /**
     * 特殊扣分申请新增接口
     */

    @PostMapping("/indexKou")
    public Result indexKou(String object, String demerit, Integer score) {
        return appraisalService.indexKou(object, demerit, score);
    }


    /**
     * 特殊扣分申请查询接口
     */

    @GetMapping("/getKouFenAll")
    public Result getKouFenAll() {
        return appraisalService.getKoufenAll();
    }


    /**
     * 特殊申请扣分根据对象查询接口
     * @param object
     * @return
     */
    @GetMapping("/queryStudents")
    public Result<Dtokoufen> queryStudents(String object) {
        return appraisalService.AppraisalService(object);
    }

    /**
     * 特殊扣分申请逻辑删除接口
     * @param demerit
     * @param deleted
     * @return
     */
    @GetMapping("/updateAppraisal")
    public Result updateAppraisal(String demerit ,Integer deleted) {
        return appraisalService.updateAppraisal(demerit ,deleted);
    }

    /**
     * 特殊扣分申诉审核查询接口
     * @return
     */
    @GetMapping("/selectAlls")
    public Result selectAlls() {
        return appraisalService.selectAlls();
    }
}
